#ifndef __CE_GFX_MESH_MORPHMESH_H__
#define __CE_GFX_MESH_MORPHMESH_H__

#include <gfx/imorphmesh.h>
#include <vector>
#include <gfx/multimesh.h>

struct iDevice;

/**
 * \addtogroup opengl
 * @{
 */

/**
 * @brief Implementation of the iMorphMesh interface.
 */
class ceMorphMeshGL20 : public iMorphMesh
{
  CE_OBJECT
private:

  ceMultiMesh		*_mesh;
  unsigned      _frame0;
  unsigned      _frame1;
  float         _blend;

public:
  ceMorphMeshGL20();
  ~ceMorphMeshGL20();

  virtual void Draw (const ceRenderEnvironment& renderEnvironment, iDevice* device);
  virtual void Update (const ceRenderEnvironment& renderEnvironment, iDevice* device);

  void SetBlend (float blend);
  void SetBlend (unsigned frame0, unsigned frame1, float blend);

  void SetMesh (ceMultiMesh* mesh);
  const ceMultiMesh* GetMesh () const;
  ceMultiMesh* GetMesh ();

  const ceBoundingBox& GetBoundingBox () const;

};

/** @} */

#endif // __CE_GFX_MESH_MESHGEOMETRY_H__
